<?php
namespace yan\editor_frontend\editor;
use yii\helpers\Html;
class WebListContainerWidget extends \yii\base\Widget{
	public $value;
	public $child;
	public $that;
    public $parent_type;

	public function run(){
		
        $shtml = Html::beginTag('div', [
			'class'=>'WebListContainerWidget '.(isset($this->value['value']['class']) ? $this->value['value']['class'] : ''),
			'style'=>(isset($this->value['value']['style']) ? $this->value['value']['style'] : ''),
			'id'=>(isset($this->value['value']['class_id']) ? $this->value['value']['class_id'] : ''),
		]);
		$shtml .= '<ul>';	
        if(!empty($this->value['childs'][0])){
            foreach ($this->value['childs'][0] as $k => $v) {
                $shtml .= '<li class="open_li '.(isset($v['value']['class']) ? $v['value']['class'] : '').'" '.(!empty($v['value']['class_id']) ? 'id="'.$v['value']['class_id'].'"' : '').' style="'.(isset($v['value']['style']) ? $v['value']['style'] : '').'">';
                $shtml .= $this->that->renderWidget($v, 'listContainerWidget');
                $shtml .= '</li>';
            }            
        }
		$shtml .= '</ul>';
        $shtml .= Html::endTag('div');
		return $shtml;
	}
}